﻿<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' dir='ltr'>
    <head>
        <title>Facebook Connect in Telligent Community Server</title>
        <style type='text/css'>
            body {
                font-family: Verdana, Arial, sans-serif;
                font-size: 0.9em;
                color: #333;
                width: 900px;
                margin: 10px auto;
                background-color:#aaa;
            }
            h1, h2, h3, h4, h5, h6 { font-family: Georgia, Times, Times New Roman; }
            code {
                font-size: 1.0em;
                color: #555;
            }
            li { padding: 7px 0px; }
            ul li { list-style-type: square; }
            #container { 
                border: solid 2px #000;
                padding: 0 15px;
                background-color: #fff;
            }
        </style>
    </head>
    <body>
        <div id='container'>
        <h1>Facebook Connect for Telligent Community Server</h1>

<p><strong>Currently only works with Community Server 2008.5</strong></p>

<h2>Features</h2>

<ul>
<li>Join the community using a Facebook account</li>
<li>Log in to your community using Facebook authentication</li>
<li>Link Facebook and existing community accounts</li>
</ul>

<h2>How to use</h2>

<p>When you install this module to your site, you will end up with a 'connect' button on the join page and a
'login with facebook' button on the sign in page. When a user joins using their facebook account, some
information is pulled from Facebook and populated in the account. A default username of: (firstname +
lastname).ToLower() will be suggested. Their Facebook account will be linked with the new account
that is about to be created.</p>

<p>When a user comes back to your community site, they will be able to login using their Facebook credentials.</p>

<p>Existing users of your site will be able to associate their account with Facebook. Once this is done,
they will then be able to login to the community with their Facebook credentials.</p>

<p><strong>Note:</strong> If the email address associated with the user on the site is not the same as the user's Facebook
email address, then things like friend linking (in future version) will not work as Facebook doesn't give
direct access to a user's email address through Facebook Connect. Connect applications have to hash the
user's email address and then submit that to Facebook for use. When a user joins the site with Facebook,
this is setup automatically, but when they associate their account, this cannot be enforced.</p>

<p>Users can remove their Facebook account association. They will be sent a 'here is your new password' email.</p>

<h2>Installation</h2>

<p>The base installation does not surface any feature in your site, but makes it available for use.</p>

<p>This is just a file copy of the dll's into your site root \bin folder and a creation of a table.</p>

<ol>
<li>Installing from source:
<ol>
<li>Compile the source (see the Development Notes section)</li>
<li>Copy all .dlls from bin\Debug or bin\Release</li>
</ol></li>
<li>Downloaded binaries: unzip the the downloaded file and copy all .dll files from the
bin folder of the archive.</li>
<li>Put the copied files in the \bin directory of your website.</li>
<li>Open <code>create_table.sql</code> and run it against your CS database.</li>
<li>Copy Web\xd_receiver.html into the site root of your existing CS installation.</li>
</ol>

<h2>Configuration</h2>

<p><strong>Note</strong> If you have not yet created an application on Facebook, you need to do so now.
Visit <a href="http://www.facebook.com/developers/createapp.php">the Facebook create application page</a>
to create an application.</p>

<p>You will need to add the controls to the pages at the right spots for their use. Copies of these
pages for a default CS 2008.5 hawaii theme installation have been provided in the Web folder.</p>

<ol>
<li><p>Add a new line to the web.config to provide access to the control.</p>

<p><code>&lt;add tagPrefix="ATGi" namespace="ATGi.CS.Facebook.Controls" assembly="AIGi.CS.Facebook" /&gt;</code></p></li>
<li><p>Add two items to the <code>&lt;appSettings&gt;</code> section of web.config for the APIKey and secret provided
when you registered your facebook application. Be sure to substitute the keys for the value attribute
in the code below.</p>

<p><code>&lt;add key="ATGi.CS.Facebook.Data.APIKey" value="2b..." /&gt;</code><br />
<code>&lt;add key="ATGi.CS.Facebook.Data.Secret" value="47..." /&gt;</code></p></li>
<li><p>You will need to add the right controls to the right pages in your site. The list of controls is:</p>

<ol>
<li>FacebookCreateUserSubForm</li>
<li>FacebookLoginButton</li>
<li>FacebookLoginForm</li>
<li>FacebookRemoveAssociationButton</li>
<li>FacebookUserData</li>
<li>FacebookProfileImage</li>
</ol></li>
</ol>

<p>The sample files in the <code>Web\Themes\hawaii</code> folder can be compared to the default hawaii to
determine the proper usage of the controls. The resource file in <code>Web\Languages\en-US</code> should be
used in support of these files.</p>

<h2>Development Notes</h2>

<ul>
<li>Open the solution and build to create the Dll's needed. You will want to add references to the
following dlls before building: CommunityServer.Components.dll,
CommunityServer.Controls.dll, Telligent.Components.dll</li>
<li>These dlls can be extracted from the Telligent Community Server downloads or referenced from
the bin directory in the community installation.</li>
<li>To create a distribution of this package, run createzip.ps1 in powershell.</li>
</ul>

<h3>Planned features</h3>

<ul>
<li>Send invitations to friends on Facebook to join the community</li>
<li>Sync Facebook and community friend lists</li>
<li>Share content in Facebook without leaving the community site</li>
</ul>

<h3>Other Information</h3>

<ul>
<li>Currently the LastAccessed column in the <code>atgi_Users_Facebook</code> table is never updated.</li>
<li>External Libraries:
<a href="http://facebooktoolkit.codeplex.com/">Facebook Developer Toolkit</a>,
<a href="http://ninject.org/">Ninject</a></li>
</ul>

<h2>License (MIT)</h2>

<blockquote>
  <p>Copyright © 2009 Active Technologies Group, Inc. (ATGi)</p>
  
  <p>Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (the "Software"), to deal in the Software without
  restriction, including without limitation the rights to use,
  copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following
  conditions:</p>
  
  <p>The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.</p>
  
  <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.</p>
</blockquote>

<p>Written by <a href="mailto:jeffesp@atgi.com">jeffesp</a> at <a href="http://www.atgi.com">ATGi</a></p>

        </div>
    </body>
</html>
